package org.space.galaxyCabinet.clients;

import org.space.galaxyCabinet.domain.DeviceBase;
import org.space.galaxyCabinet.domain.DeviceStatus;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(
    name = "DeviceStatusClients",
    url = "http://localhost:8080/vending"
)
public interface DeviceStatusClients {
    @RequestMapping(method = RequestMethod.PUT, value = "/status/updateByDeviceNo", consumes = "application/json")
    String updateByDeviceNo(@RequestBody DeviceStatus deviceStatus);

    @RequestMapping(method = RequestMethod.PUT, value = "/status/onlineByDeviceNo/{deviceNo}", consumes = "application/json")
    String updateOnlineByDeviceNo(@PathVariable String deviceNo);

    // 修改设备在线状态
    @RequestMapping(method = RequestMethod.PUT, value = "/base/updateStatusByDeviceNo", consumes = "application/json")
    String updateStatusByDeviceNo(@RequestBody DeviceBase deviceBase);
}
